package com.ruandi;
class Cat{
    private String color;
    private String breed;
    public Cat(){}
    public Cat(String color,String breed){
        this.color = color;
        this.breed = breed;
    }
    public String getColor(){
        return color;
    }
    public void setColor(String color){
        this.color = color;
    }
    public String getBreed(){
        return breed;
    }
    public void setBreed(String breed){
        this.breed = breed;
    }
    public void eat(){
        System.out.println(color+"的"+breed+"正在吃鱼");
    }
    public void catchMouse(){
        System.out.println(color+"的"+breed+"正在逮老鼠");
    }
}
class Dog{
    private String color;
    private String breed;
    public Dog(){}
    public Dog(String color,String breed){
        this.color = color;
        this.breed = breed;
    }
    public String getColor(){
        return color;
    }
    public void setColor(String color){
        this.color = color;
    }
    public String getBreed(){
        return breed;
    }
    public void setBreed(String breed){
        this.breed = breed;
    }
    public void eat(){
        System.out.println(color+"的"+breed+"正在啃骨头");
    }
    public void lookHome(){
        System.out.println(color+"的"+breed+"正在看家");
    }
}
public class Test4 {
    public static void main(String[] args) {
        Cat cat = new Cat("花色", "波斯猫");
        cat.eat();
        cat.catchMouse();
        cat.setBreed("花猫");
        cat.setColor("黑白相间");
        cat.eat();
        cat.catchMouse();
        Dog dog = new Dog("黑色", "藏獒");
        dog.eat();
        dog.lookHome();
        dog.setBreed("黄狗");
        dog.setColor("黄色");
        dog.eat();
        dog.lookHome();
    }
}
